package com.zy.ivideo.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.util.Date;

@Entity
@EntityListeners(AuditingEntityListener.class)
@Data
@ApiModel(value = "视频作者实体类",description = "视频作者实体类")
@Table(name = "b_video_author")
public class VideoAuthorEntity {

    @ApiModelProperty(value = "主键id",position = 16,example = "0")
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;


    @Column(name = "avatar_url",length = 255,nullable = false)
    private String avatar_url;

    @ApiModelProperty(value = "名称",position = 16,example = "")
    @Column(name = "name",length = 100,nullable = false)
    private String name;

    @ApiModelProperty(value = "描述",position = 16,example = "")
    @Column(name = "description",length = 255)
    private String description;

    @ApiModelProperty(value = "用户id",position = 16,example = "")
    @Column(name = "user_id",nullable = false)
    private String user_id;

    @ApiModelProperty(value = "作者描述",position = 16,example = "")
    @Column(name = "author_desc")
    private String author_desc;

    @ApiModelProperty(value = "鲜花数",position = 16,example = "500")
    @Column(name = "followerscount")
    private String followerscount;

    @ApiModelProperty(value = "校验码",position = 16,example = "aabbccdd")
    @Column(name = "verifycode")
    private String verifycode;

    /**
     * 创建日期
     */
    @ApiModelProperty(value = "创建日期",position = 16,example = "2024-01-01 00:00:00")
    @CreatedDate
    @Column()
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date ctime;
}
